<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
    <title>Donxon SDK Docs</title>
    <link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

<div id="container">

<div id="product">
	<div id="product_logo"></div>
	<div id="product_name"><big><b></b></big></div>
	<div id="product_description"></div>
</div> <!-- id="product" -->


<div id="main">


<!-- Menu -->

<div id="navigation">
<br/>
<h1>Donxon SDK</h1>

<ul>
  <li><a href="../index.html">Index</a></li>
</ul>

<h2>Contents</h2>
<ul>
<li><a href="#Methods">Methods</a></li>
</ul>


<h2>Classes</h2>
<ul class="nowrap">
  <li><a href="../classes/Debug.html">Debug</a></li>
  <li><a href="../classes/StringBuffer.html">StringBuffer</a></li>
  <li><a href="../classes/Hook.html">Hook</a></li>
  <li><strong>System.UTF8</strong></li>
  <li><a href="../classes/Common.Color.html">Common.Color</a></li>
  <li><a href="../classes/Common.Vector2D.html">Common.Vector2D</a></li>
  <li><a href="../classes/Common.Vector.html">Common.Vector</a></li>
  <li><a href="../classes/Common.NetMessage.html">Common.NetMessage</a></li>
  <li><a href="../classes/Common.TextMenu.html">Common.TextMenu</a></li>
  <li><a href="../classes/Common.ScreenFade.html">Common.ScreenFade</a></li>
  <li><a href="../classes/Common.HUDText.html">Common.HUDText</a></li>
  <li><a href="../classes/Game.NetMessage.html">Game.NetMessage</a></li>
  <li><a href="../classes/Game.TextMenu.html">Game.TextMenu</a></li>
  <li><a href="../classes/Game.ScreenFade.html">Game.ScreenFade</a></li>
  <li><a href="../classes/Game.BarTime.html">Game.BarTime</a></li>
  <li><a href="../classes/UI.Rectangle.html">UI.Rectangle</a></li>
  <li><a href="../classes/UI.ProgressBar.html">UI.ProgressBar</a></li>
  <li><a href="../classes/UI.TextMenu.html">UI.TextMenu</a></li>
  <li><a href="../classes/UI.ScreenFade.html">UI.ScreenFade</a></li>
  <li><a href="../classes/UI.BarTime.html">UI.BarTime</a></li>
</ul>
<h2>Globals</h2>
<ul class="nowrap">
  <li><a href="../globals/Properties.html">Properties</a></li>
  <li><a href="../globals/Functions.html">Functions</a></li>
  <li><a href="../globals/Classes.html">Classes</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
  <li><a href="../modules/System.html">System</a></li>
  <li><a href="../modules/Common.html">Common</a></li>
  <li><a href="../modules/Game.html">Game</a></li>
  <li><a href="../modules/UI.html">UI</a></li>
</ul>
<h2>Topics</h2>
<ul class="">
  <li><a href="../topics/changelog.md.html">changelog</a></li>
  <li><a href="../topics/credit.md.html">credit</a></li>
  <li><a href="../topics/license.html">license</a></li>
</ul>
<h2>Examples</h2>
<ul class="nowrap">
  <li><a href="../examples/bartime.game.lua.html">bartime.game.lua</a></li>
  <li><a href="../examples/bartime.ui.lua.html">bartime.ui.lua</a></li>
  <li><a href="../examples/deltatiming.game.lua.html">deltatiming.game.lua</a></li>
  <li><a href="../examples/deltatiming.ui.lua.html">deltatiming.ui.lua</a></li>
  <li><a href="../examples/hook.game.lua.html">hook.game.lua</a></li>
  <li><a href="../examples/netmsg.simple.common.lua.html">netmsg.simple.common.lua</a></li>
  <li><a href="../examples/netmsg.simple.game.lua.html">netmsg.simple.game.lua</a></li>
  <li><a href="../examples/netmsg.simple.ui.lua.html">netmsg.simple.ui.lua</a></li>
  <li><a href="../examples/progressbar.ui.lua.html">progressbar.ui.lua</a></li>
  <li><a href="../examples/rectangle.ui.lua.html">rectangle.ui.lua</a></li>
  <li><a href="../examples/screenfade.game.lua.html">screenfade.game.lua</a></li>
  <li><a href="../examples/screenfade.ui.lua.html">screenfade.ui.lua</a></li>
  <li><a href="../examples/stringbuffer.lua.html">stringbuffer.lua</a></li>
  <li><a href="../examples/textmenu.simple.game.lua.html">textmenu.simple.game.lua</a></li>
  <li><a href="../examples/utf8.lua.html">utf8.lua</a></li>
  <li><a href="../examples/vector.2d.lua.html">vector.2d.lua</a></li>
  <li><a href="../examples/vector.3d.lua.html">vector.3d.lua</a></li>
</ul>

</div>

<div id="content">

<h1>Class <code>System.UTF8</code></h1>
<p>UTF-8 library class.</p>
<p> Provides UTF-8 aware string functions implemented in pure lua.</p>

<p> All functions behave as their non UTF-8 aware counterparts with the exception
 that UTF-8 characters are used instead of bytes for all units.</p>


<h2><a href="#Methods">Methods</a></h2>
<table class="function_list">
	<tr>
	<td class="name" nowrap><a href="#System.UTF8:byte">System.UTF8:byte (s[, i=1[, j=i]])</a></td>
	<td class="summary"><a href="https://www.lua.org/manual/5.1/manual.html#pdf-string.byte">string.byte</a> equivalent for UTF-8 strings.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#System.UTF8:char">System.UTF8:char (...)</a></td>
	<td class="summary"><a href="https://www.lua.org/manual/5.1/manual.html#pdf-string.char">string.char</a> equivalent for UTF-8 strings.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#System.UTF8:find">System.UTF8:find (s, pattern[, init[, plain]])</a></td>
	<td class="summary"><a href="https://www.lua.org/manual/5.1/manual.html#pdf-string.find">string.find</a> equivalent for UTF-8 strings.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#System.UTF8:gmatch">System.UTF8:gmatch (s, pattern[, all])</a></td>
	<td class="summary"><a href="https://www.lua.org/manual/5.1/manual.html#pdf-string.gmatch">string.gmatch</a> equivalent for UTF-8 strings.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#System.UTF8:gsub">System.UTF8:gsub (s, pattern, repl[, n])</a></td>
	<td class="summary"><a href="https://www.lua.org/manual/5.1/manual.html#pdf-string.gsub">string.gsub</a> equivalent for UTF-8 strings.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#System.UTF8:len">System.UTF8:len (s)</a></td>
	<td class="summary"><a href="https://www.lua.org/manual/5.1/manual.html#pdf-string.len">string.len</a> equivalent for UTF-8 strings.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#System.UTF8:match">System.UTF8:match (s, pattern[, init])</a></td>
	<td class="summary"><a href="https://www.lua.org/manual/5.1/manual.html#pdf-string.match">string.match</a> equivalent for UTF-8 strings.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#System.UTF8:sub">System.UTF8:sub (s, i[, j])</a></td>
	<td class="summary"><a href="https://www.lua.org/manual/5.1/manual.html#pdf-string.sub">string.sub</a> equivalent for UTF-8 strings.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#System.UTF8:reverse">System.UTF8:reverse (s)</a></td>
	<td class="summary"><a href="https://www.lua.org/manual/5.1/manual.html#pdf-string.reverse">string.reverse</a> equivalent for UTF-8 strings.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#System.UTF8:codes">System.UTF8:codes (s)</a></td>
	<td class="summary">Returns an iterator which iterate over all characters in string s,
 with p being the position (in bytes) and c the code point of each character.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#System.UTF8:gensub">System.UTF8:gensub (s[, len=1])</a></td>
	<td class="summary">Returns an iterator which returns the next substring and its byte interval.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#System.UTF8.explode">System.UTF8.explode (source, delimiter)</a></td>
	<td class="summary"><code>string.explode</code> equivalent for UTF-8 strings.</td>
	</tr>
</table>

<br/>
<br/>


    <h2 class="section-header "><a name="Methods"></a>Methods</h2>

    <dl class="function">
    <dt>
    <a name = "System.UTF8:byte"></a>
    <strong>System.UTF8:byte (s[, i=1[, j=i]])</strong>
    </dt>
    <dd>
    <a href="https://www.lua.org/manual/5.1/manual.html#pdf-string.byte">string.byte</a> equivalent for UTF-8 strings.


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">s</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>



        </li>
        <li><span class="parameter">i</span>
            <span class="types"><span class="type">number</span></span>



         (<em>default</em> 1)
        </li>
        <li><span class="parameter">j</span>
            <span class="types"><span class="type">number</span></span>



         (<em>default</em> i)
        </li>
    </ul>

    <h3>Returns:</h3>
    <ol>

           <span class="types"><span class="type">...</span></span>
        Char codes in lua number.
    </ol>




</dd>
    <dt>
    <a name = "System.UTF8:char"></a>
    <strong>System.UTF8:char (...)</strong>
    </dt>
    <dd>
    <a href="https://www.lua.org/manual/5.1/manual.html#pdf-string.char">string.char</a> equivalent for UTF-8 strings.


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">...</span>
         UTF-8 code integers.
        </li>
    </ul>

    <h3>Returns:</h3>
    <ol>

           <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>



    </ol>




</dd>
    <dt>
    <a name = "System.UTF8:find"></a>
    <strong>System.UTF8:find (s, pattern[, init[, plain]])</strong>
    </dt>
    <dd>
    <a href="https://www.lua.org/manual/5.1/manual.html#pdf-string.find">string.find</a> equivalent for UTF-8 strings.


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">s</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>



        </li>
        <li><span class="parameter">pattern</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>



        </li>
        <li><span class="parameter">init</span>
            <span class="types"><span class="type">number</span></span>



         (<em>optional</em>)
        </li>
        <li><span class="parameter">plain</span>
            <span class="types"><span class="type">boolean</span></span>



         (<em>optional</em>)
        </li>
    </ul>

    <h3>Returns:</h3>
    <ol>

        find result.
    </ol>




</dd>
    <dt>
    <a name = "System.UTF8:gmatch"></a>
    <strong>System.UTF8:gmatch (s, pattern[, all])</strong>
    </dt>
    <dd>
    <a href="https://www.lua.org/manual/5.1/manual.html#pdf-string.gmatch">string.gmatch</a> equivalent for UTF-8 strings.


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">s</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>



        </li>
        <li><span class="parameter">pattern</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>



        </li>
        <li><span class="parameter">all</span>
            <span class="types"><span class="type">boolean</span></span>



         (<em>optional</em>)
        </li>
    </ul>

    <h3>Returns:</h3>
    <ol>

           <span class="types"><span class="type">function</span></span>



    </ol>




</dd>
    <dt>
    <a name = "System.UTF8:gsub"></a>
    <strong>System.UTF8:gsub (s, pattern, repl[, n])</strong>
    </dt>
    <dd>
    <a href="https://www.lua.org/manual/5.1/manual.html#pdf-string.gsub">string.gsub</a> equivalent for UTF-8 strings.


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">s</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>



        </li>
        <li><span class="parameter">pattern</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>



        </li>
        <li><span class="parameter">repl</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a>, <a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.5">table</a> or <span class="type">function</span></span>



        </li>
        <li><span class="parameter">n</span>
            <span class="types"><span class="type">number</span></span>



         (<em>optional</em>)
        </li>
    </ul>

    <h3>Returns:</h3>
    <ol>

           <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>



    </ol>




</dd>
    <dt>
    <a name = "System.UTF8:len"></a>
    <strong>System.UTF8:len (s)</strong>
    </dt>
    <dd>
    <a href="https://www.lua.org/manual/5.1/manual.html#pdf-string.len">string.len</a> equivalent for UTF-8 strings.


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">s</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>



        </li>
    </ul>

    <h3>Returns:</h3>
    <ol>

           <span class="types"><span class="type">number</span></span>



    </ol>




</dd>
    <dt>
    <a name = "System.UTF8:match"></a>
    <strong>System.UTF8:match (s, pattern[, init])</strong>
    </dt>
    <dd>
    <a href="https://www.lua.org/manual/5.1/manual.html#pdf-string.match">string.match</a> equivalent for UTF-8 strings.


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">s</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>



        </li>
        <li><span class="parameter">pattern</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>



        </li>
        <li><span class="parameter">init</span>
            <span class="types"><span class="type">number</span></span>



         (<em>optional</em>)
        </li>
    </ul>

    <h3>Returns:</h3>
    <ol>

        match result.
    </ol>




</dd>
    <dt>
    <a name = "System.UTF8:sub"></a>
    <strong>System.UTF8:sub (s, i[, j])</strong>
    </dt>
    <dd>
    <a href="https://www.lua.org/manual/5.1/manual.html#pdf-string.sub">string.sub</a> equivalent for UTF-8 strings.


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">s</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>



        </li>
        <li><span class="parameter">i</span>
            <span class="types"><span class="type">number</span></span>



        </li>
        <li><span class="parameter">j</span>
            <span class="types"><span class="type">number</span></span>



         (<em>optional</em>)
        </li>
    </ul>

    <h3>Returns:</h3>
    <ol>

           <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>



    </ol>




</dd>
    <dt>
    <a name = "System.UTF8:reverse"></a>
    <strong>System.UTF8:reverse (s)</strong>
    </dt>
    <dd>
    <a href="https://www.lua.org/manual/5.1/manual.html#pdf-string.reverse">string.reverse</a> equivalent for UTF-8 strings.


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">s</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>



        </li>
    </ul>

    <h3>Returns:</h3>
    <ol>

           <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>



    </ol>




</dd>
    <dt>
    <a name = "System.UTF8:codes"></a>
    <strong>System.UTF8:codes (s)</strong>
    </dt>
    <dd>
    Returns an iterator which iterate over all characters in string s,
 with p being the position (in bytes) and c the code point of each character.


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">s</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>



        </li>
    </ul>

    <h3>Returns:</h3>
    <ol>

           <span class="types"><span class="type">function</span></span>
        Returns variable (p, c).
    </ol>




</dd>
    <dt>
    <a name = "System.UTF8:gensub"></a>
    <strong>System.UTF8:gensub (s[, len=1])</strong>
    </dt>
    <dd>
    Returns an iterator which returns the next substring and its byte interval.


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">s</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>



        </li>
        <li><span class="parameter">len</span>
            <span class="types"><span class="type">number</span></span>
         The string length of each substrings.
         (<em>default</em> 1)
        </li>
    </ul>

    <h3>Returns:</h3>
    <ol>

           <span class="types"><span class="type">function</span></span>
        Returns variable (substring, startPos, endPos).
    </ol>




</dd>
    <dt>
    <a name = "System.UTF8.explode"></a>
    <strong>System.UTF8.explode (source, delimiter)</strong>
    </dt>
    <dd>
    <code>string.explode</code> equivalent for UTF-8 strings.


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">source</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
         The string to explode.
        </li>
        <li><span class="parameter">delimiter</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
         The string delimiter.
        </li>
    </ul>

    <h3>Returns:</h3>
    <ol>

           <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.5">table</a></span>
        The result.
    </ol>




</dd>
</dl>


</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-06-15 21:15:36 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>
